package com.hpradip.android.documentaryHub.Utils;

import java.io.InputStream;
import java.net.URL;

import android.graphics.drawable.Drawable;
import android.util.Log;

public class ImageUtilities {
	public static Drawable loadImage(String url) {
		if(url==null)
return null;
try {
			InputStream is = (InputStream) fetch(url);
			Drawable d = Drawable.createFromStream(is, "src");
			return d;
		} catch (Exception ee) {
			Log.e("ImageUtilities",ee.getMessage());
			return null;
		}
	}

	public static Object fetch(String address) throws Exception{
		URL url = new URL(address);
		Object content = url.getContent();
		return content;
	}
}
